<script>
function getby_code(code){
	var name= $('#product_name').val()
	var category = $('#product_category').val()
	
$.post("<?= site_url('sales/search/getby_code')?>",{ code : code, name:name, category: category }, function(msg){
							if(msg){
								$("#report").show();
								$("#report").html(msg);
								
							}
		
						})
	
}
function getby_name(name){
	var code= $('#product_code').val()
	var category = $('#product_category').val()
$.post("<?= site_url('sales/search/getby_name')?>",{ name : name, code : code, category: category}, function(msg){
							if(msg){
									$("#report").show();
								$("#report").html(msg);
								
						}
		
						})
	
}

function getby_category(category){
		var code= $('#product_code').val()
	var name = $('#product_name').val()
$.post("<?= site_url('sales/search/getby_category')?>",{ category : category, code : code, name:name}, function(msg){
							if(msg){
									$("#report").show();
								$("#report").html(msg);
								
						}
		
						})
	
}

</script>

<h2>Search Item </h2>
<div class="row-fluid">
<div class="span2">&nbsp;&nbsp;&nbsp;</div>
<div class="span8">
<table width="100%" >
<tr>
<td><b>Item Code: </b></td>
<td>&nbsp;</td>
<td><b>Item Name: </b></td>
<td>&nbsp;</td>
<td><b>Item Category:</b></td>
</tr>
<tr> 
<td><input type="text" onkeyup="getby_code(this.value)"  id="product_code"></td>
<td><b>OR</b></td>
<td><input type="text" onkeyup="getby_name(this.value)"  id="product_name"></td>
<td><b>OR</b></td>
<td><input type="text" onkeyup="getby_category(this.value)"  id="product_category"></td>
</tr>

	</table>
	</div>
	<div class="span2">&nbsp;&nbsp;&nbsp;</div>
</div>	
<div class="line"></div>
<div class="row-fluid">
<div class="span12" id="report" style="display: none">
lkhkjthkjtrhekj
</div>	
	